package com.flash.SystemManagement.service.impl;

import com.flash.SystemManagement.entity.User;
import com.flash.SystemManagement.mapper.UserMapper;
import com.flash.SystemManagement.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;


@Service
public class UserServiceImpl implements UserService {
    @Resource
    UserMapper userMapper;

    @Override
    public List<User> selectUser(){
        return userMapper.selectUser();
    }

    @Override
    public int insertUsers(User user) {
        return userMapper.insertUsers(user);
    }

    @Override
    public int deleteUsers(int userId) {
        return userMapper.deleteUsers(userId);
    }

    @Override
    public List<User> selectLikeUser(String userName, int page, int limit) {
        HashMap map = new HashMap();
        map.put("userName" , userName);
        map.put("page",(page-1)*limit);
        map.put("limit",limit);
        return userMapper.selectLikeUser(map);
    }

    @Override
    public int updateUser(User user) {
        return userMapper.updateUser(user);
    }



}
